///////////////////////////////////////////////////////////
//  CCheckListView.h
//  Implementation of the Class CCheckListView
//  Created on:      21-Sep-2013 9:36:12 AM
//  Original author: Jakkaphan Aiemcharoenjit
///////////////////////////////////////////////////////////

#if !defined(EA_E73D8C47_34E7_4850_9921_FFF482DC32FD__INCLUDED_)
#define EA_E73D8C47_34E7_4850_9921_FFF482DC32FD__INCLUDED_

#include "IViewCtrl.h"
#include "IPages.h"
#include "IWindowDirector.h"

using namespace Data;

namespace UI
{
class CCheckListView : public IViewCtrl
{

public:
	CCheckListView(IPages* checklistPages, IWindowDirector* director);
  virtual ~CCheckListView();
	virtual IViewCtrl::ViewType GetType() const;
	virtual void Initialize();
	virtual void Refresh();
	virtual void ShowView(bool show = true);
	void OnSelectedPage();
	bool OnClickedEdit(CButton* button);
  bool OnClickedView(CButton* button);
  bool OnClickedRemove(CButton* button);
	void OnClickedSendMail();
	Data::IPage* GetCurSelected();
  void AppendPage(IPage* newPage);
  void EditPage(IPage* newPage);

private:
  bool OnClickedNavigationBar(CNavigationBar *naviBar, int button);
  bool OnClickedToolBar(CToolBar* toolBar, int button);
  bool OnSelectedTable(CTable* table, int tab);
  bool OnAlertButtonClick(CAlertDialog* dialog, EAlertDialogButton button);

private:
	IViewCtrl::ViewType m_type;
	IPages*             m_checkListPages;
	int                 m_currentRow;
	IWindowDirector*    m_parrentWnd;
  CNavigationBarPtr   m_navigationBar;
  CTablePtr           m_table;
  CToolBarPtr         m_toolBar;
  std::vector<CTableItemPtr> m_tableRows;
  CAlertDialogPtr     m_alretDlg;
};
}
#endif // !defined(EA_E73D8C47_34E7_4850_9921_FFF482DC32FD__INCLUDED_)
